GtkStyleContext: Add gtk_style_context_list_child_classes().
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 23 Apr 2010 00:31:57 +0000 (02:31 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:37:09 +0000 (15:37 +0100)
gtk/gtkstylecontext.c
gtk/gtkstylecontext.h

index f8f6c080405e72c7ea9c113dcb5336418c38131a..c4401cc155cf8b8c9539c75b1baab523e1de5f96 100644 (file)
@@ -473,6 +473,31 @@ child_style_class_compare (gconstpointer p1,
   return (gint) c1->class_quark - c2->class_quark;
 }
 
+GList *
+gtk_style_context_list_child_classes (GtkStyleContext *context)
+{
+  GtkStyleContextPrivate *priv;
+  GList *classes = NULL;
+  GList *link;
+
+  g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
+
+  priv = GTK_STYLE_CONTEXT_GET_PRIVATE (context);
+  link = priv->child_style_classes;
+
+  while (link)
+    {
+      GtkChildClass *link_class;
+
+      link_class = link->data;
+      classes = g_list_prepend (classes,
+                                g_quark_to_string (link_class->class_quark));
+      link = link->next;
+    }
+
+  return classes;
+}
+
 void
 gtk_style_context_set_child_class (GtkStyleContext    *context,
                                    const gchar        *class_name,
index a9ddd75e7a4de6a7a25f566114e4bcbf08e97f6a..2ef9ee12c9007f44bf06c8c989033ce0616e9e47 100644 (file)
@@ -84,6 +84,8 @@ void     gtk_style_context_unset_class (GtkStyleContext *context,
 gboolean gtk_style_context_has_class   (GtkStyleContext *context,
                                         const gchar     *class_name);
 
+GList *  gtk_style_context_list_child_classes (GtkStyleContext *context);
+
 void     gtk_style_context_set_child_class   (GtkStyleContext    *context,
                                               const gchar        *class_name,
                                               GtkChildClassFlags  flags);